package bookworm;
import java.util.LinkedList;

import retrievedatafromrevishapi.AccessBooksData;


public class GetRecentReviews
{	
	/**
	 * get the most recent reviews with the tag specified
	 * @param tag tag that the recent reviews must be related to.
	 * @return the most recent reviews with the tag specified
	 */
	public static LinkedList<Review> getRecentReviewsByTag(String tag)
	{
		LinkedList<String> searchArguments = new LinkedList<String>();
		searchArguments.add("sortby");
		searchArguments.add("tag");
		LinkedList<String> argumentsValue = new LinkedList<String>();
		argumentsValue.add("dateasc");
		argumentsValue.add(tag);
		AccessBooksData acessRevishAPI = AccessBooksData.getAccessBooksData();
		LinkedList<Review> reviewsFromCurrentDate = 
				acessRevishAPI.getBookReviewsFromRevishAPI(searchArguments, argumentsValue);
		return reviewsFromCurrentDate;
	}

}
